package com.jfs.security.controller;

import com.jfs.entity.Role;
import com.jfs.result.Result;
import com.jfs.security.service.RoleService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 角色控制器
 * @E-mail cwm3412638@163.com
 * @Author cwm
 * @Date 2022/8/9
 */
@RestController
@RequestMapping("/role")
@AllArgsConstructor
public class RoleController {
    private final RoleService roleService;

    /**
     * 获取角色下拉列表
     *
     * @return
     */
    @GetMapping
    public Result<List<Role>> dropList() {
        return Result.success("获取角色下拉列表成功", this.roleService.list());
    }
}
